{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([[ 1.17124956,  2.22599482],\n",
       "        [ 1.05840256,  2.71499082],\n",
       "        [ 0.12629956, -0.19105918],\n",
       "        ...,\n",
       "        [ 0.79098556,  0.10539082],\n",
       "        [ 0.05064356,  0.03821282],\n",
       "        [ 1.27096256, -0.55239818]]),\n",
       " (1000, 2))"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "\n",
    "def load_data(file_name):\n",
    "    with open(file_name) as fr:\n",
    "        lines = fr.readlines()\n",
    "\n",
    "    x = np.empty((len(lines), 2))\n",
    "    for i in range(len(lines)):\n",
    "        line = lines[i].split('\\t')\n",
    "        x[i] = line\n",
    "\n",
    "    #均值为0\n",
    "    x -= x.mean(axis=0)\n",
    "\n",
    "    return x\n",
    "\n",
    "\n",
    "x = load_data('简单数据.txt')\n",
    "x, x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.52045195, -0.85389096])"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#求特征向量\n",
    "def get_vs():\n",
    "    #求协方差\n",
    "    cov = np.cov(x, rowvar=0)\n",
    "    #[[1.05198368 1.1246314 ]\n",
    "    # [1.1246314  2.21166499]]\n",
    "\n",
    "    #求特征值和特征向量\n",
    "    lams, vs = np.linalg.eig(cov)\n",
    "    \n",
    "    #取特征值最大的下标\n",
    "    argsort = lams.argmax()\n",
    "    \n",
    "    #特征值最大的特征向量\n",
    "    return vs[:, argsort]\n",
    "\n",
    "\n",
    "vs = get_vs()\n",
    "vs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([-2.51033597, -2.86915379,  0.09741085, -0.76778222,  1.02715333]),\n",
       " (1000,))"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#压缩数据\n",
    "def x_to_p():\n",
    "    return x.dot(vs)\n",
    "\n",
    "\n",
    "p = x_to_p()\n",
    "p[:5], p.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1000, 2)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#压缩的数据还原,主要是为了画图\n",
    "def p_to_x():\n",
    "    return p.reshape(-1, 1).dot(vs.reshape(1, -1))\n",
    "\n",
    "\n",
    "a = p_to_x()\n",
    "a.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO2df7hU5XXvv2vm7IE5YBiopJEjKrUWWvwB8Wh8StoUtWKDENQKFa02ptfm2jSC5jQYvXKw8cm55SZgbmsb79XnCfVHOBE9gtSriZhbpRcTfiMRE39FGNKGRIZWznjOPjPv/WPOnrNnz/vu/e4f82PPrM/z+CBzZvZ+Z4bz3Wuv97vWIiEEGIZhmPiSaPQCGIZhmHCwkDMMw8QcFnKGYZiYw0LOMAwTc1jIGYZhYk5HI0566qmnirPOOqsRp2YYhoktu3bt+qUQYqrz8YYI+VlnnYWdO3c24tQMwzCxhYh+JnucUysMwzAxh4WcYRgm5rCQMwzDxBwWcoZhmJjDQs4wDBNzGuJaYRgmfgzsyWLt82/gaC6PaZk0ehbM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Fj8+62TkCYLrt76cDONqgtbQ8o3nmTQAeE0I81ej1+EEIkSOiHwC4EkBsNpntxCIid4OIzrH9dTGAQ41aix+I6EoAXwawWAgx2Oj1tCA/AnAOEc0gohSAPwGwucFraklGNw4fBvC6EOIbjV6PDkQ01XKKEVEawOWIiXbIaAXXyiYAM1FyU/wMwOeFENnGrsobInoTwDgAvxp9aEezu22I6GoA/xPAVAA5AHuFEAsauyo1RPRpAOsBJAE8IoS4v8FL8oSIngDwByi1Vv13AKuFEA83dFEeENEnAbwM4ABKv4cA8BUhxD83blXuENH5AL6N0r+NBIB+IcR9jV1VcGIv5AzDMO1O7FMrDMMw7Q4LOcMwTMxhIWcYhok5LOQMwzAxh4WcYRgm5rCQMwzDxBwWcoZhmJjz/wGeolLanAyn3gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#画图\n",
    "\n",
    "from matplotlib import pyplot as plt\n",
    "plt.scatter(x[:, 0], x[:, 1])\n",
    "plt.scatter(a[:, 0], a[:, 1])\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
